android.ndk.sensor

@file sensor.h

Members

Aliases

ASensorList
alias ASensorList = const(ASensor*)*

{@link ASensorList} is an array of reference to {@link ASensor}.

ASensorRef
alias ASensorRef = const(ASensor)*

{@link ASensorRef} is a type for constant pointers to {@link ASensor}.

Enums

AREPORTING_MODE_INVALID
enum AREPORTING_MODE_INVALID

Sensor Reporting Modes.

ASENSOR_ADDITIONAL_INFO_BEGIN
enum ASENSOR_ADDITIONAL_INFO_BEGIN

Sensor Additional Info Types.

ASENSOR_DIRECT_CHANNEL_TYPE_SHARED_MEMORY
enum ASENSOR_DIRECT_CHANNEL_TYPE_SHARED_MEMORY

Sensor Direct Channel Type.

ASENSOR_DIRECT_RATE_STOP
enum ASENSOR_DIRECT_RATE_STOP

Sensor Direct Report Rates.

ASENSOR_STATUS_NO_CONTACT
enum ASENSOR_STATUS_NO_CONTACT

Sensor accuracy measure.

ASENSOR_TYPE_INVALID
enum ASENSOR_TYPE_INVALID

Sensor types.

Functions

ASensorEventQueue_disableSensor
int ASensorEventQueue_disableSensor(ASensorEventQueue* queue, const(ASensor)* sensor)

Disable the selected sensor.

ASensorEventQueue_enableSensor
int ASensorEventQueue_enableSensor(ASensorEventQueue* queue, const(ASensor)* sensor)

Enable the selected sensor at default sampling rate.

ASensorEventQueue_getEvents
ssize_t ASensorEventQueue_getEvents(ASensorEventQueue* queue, ASensorEvent* events, size_t count)

Retrieve pending events in sensor event queue

ASensorEventQueue_hasEvents
int ASensorEventQueue_hasEvents(ASensorEventQueue* queue)

Determine if a sensor event queue has pending event to be processed.

ASensorEventQueue_registerSensor
int ASensorEventQueue_registerSensor(ASensorEventQueue* queue, const(ASensor)* sensor, int samplingPeriodUs, long maxBatchReportLatencyUs)

Enable the selected sensor with sampling and report parameters

ASensorEventQueue_requestAdditionalInfoEvents
int ASensorEventQueue_requestAdditionalInfoEvents(ASensorEventQueue* queue, bool enable)

Request that {@link ASENSOR_TYPE_ADDITIONAL_INFO} events to be delivered on the given {@link ASensorEventQueue}.

ASensorEventQueue_setEventRate
int ASensorEventQueue_setEventRate(ASensorEventQueue* queue, const(ASensor)* sensor, int usec)

Sets the delivery rate of events in microseconds for the given sensor.

ASensorManager_configureDirectReport
int ASensorManager_configureDirectReport(ASensorManager* manager, const(ASensor)* sensor, int channelId, int rate)

Configure direct report on channel

ASensorManager_createEventQueue
ASensorEventQueue* ASensorManager_createEventQueue(ASensorManager* manager, ALooper* looper, int ident, ALooper_callbackFunc callback, void* data)

Creates a new sensor event queue and associate it with a looper.

ASensorManager_createHardwareBufferDirectChannel
int ASensorManager_createHardwareBufferDirectChannel(ASensorManager* manager, const(AHardwareBuffer)* buffer, size_t size)

Create direct channel based on AHardwareBuffer

ASensorManager_createSharedMemoryDirectChannel
int ASensorManager_createSharedMemoryDirectChannel(ASensorManager* manager, int fd, size_t size)

Create direct channel based on shared memory

ASensorManager_destroyDirectChannel
void ASensorManager_destroyDirectChannel(ASensorManager* manager, int channelId)

Destroy a direct channel

ASensorManager_destroyEventQueue
int ASensorManager_destroyEventQueue(ASensorManager* manager, ASensorEventQueue* queue)

Destroys the event queue and free all resources associated to it.

ASensorManager_getDefaultSensor
const(ASensor)* ASensorManager_getDefaultSensor(ASensorManager* manager, int type)

Returns the default sensor for the given type, or NULL if no sensor of that type exists.

ASensorManager_getDefaultSensorEx
const(ASensor)* ASensorManager_getDefaultSensorEx(ASensorManager* manager, int type, bool wakeUp)

Returns the default sensor with the given type and wakeUp properties or NULL if no sensor of this type and wakeUp properties exists.

ASensorManager_getInstance
ASensorManager* ASensorManager_getInstance()

Get a reference to the sensor manager. ASensorManager is a singleton per package as different packages may have access to different sensors.

ASensorManager_getInstanceForPackage
ASensorManager* ASensorManager_getInstanceForPackage(const(char)* packageName)

Get a reference to the sensor manager. ASensorManager is a singleton per package as different packages may have access to different sensors.

ASensorManager_getSensorList
int ASensorManager_getSensorList(ASensorManager* manager, ASensorList* list)

Returns the list of available sensors.

ASensor_getFifoMaxEventCount
int ASensor_getFifoMaxEventCount(const(ASensor)* sensor)

Returns the maximum size of batches for this sensor. Batches will often be smaller, as the hardware fifo might be used for other sensors.

ASensor_getFifoReservedEventCount
int ASensor_getFifoReservedEventCount(const(ASensor)* sensor)

Returns the hardware batch fifo size reserved to this sensor.

ASensor_getHandle
int ASensor_getHandle(const(ASensor)* sensor)

Returns the sensor's handle.

ASensor_getHighestDirectReportRateLevel
int ASensor_getHighestDirectReportRateLevel(const(ASensor)* sensor)

Get the highest direct rate level that a sensor support.

ASensor_getMinDelay
int ASensor_getMinDelay(const(ASensor)* sensor)

Returns the minimum delay allowed between events in microseconds. A value of zero means that this sensor doesn't report events at a constant rate, but rather only when a new data is available.

ASensor_getName
const(char)* ASensor_getName(const(ASensor)* sensor)

Returns this sensor's name (non localized)

ASensor_getReportingMode
int ASensor_getReportingMode(const(ASensor)* sensor)

Returns the reporting mode for this sensor. One of AREPORTING_MODE_* constants.

ASensor_getResolution
float ASensor_getResolution(const(ASensor)* sensor)

Returns this sensors's resolution

ASensor_getStringType
const(char)* ASensor_getStringType(const(ASensor)* sensor)

Returns this sensor's string type.

ASensor_getType
int ASensor_getType(const(ASensor)* sensor)

Return this sensor's type

ASensor_getVendor
const(char)* ASensor_getVendor(const(ASensor)* sensor)

Returns this sensor's vendor's name (non localized)

ASensor_isDirectChannelTypeSupported
bool ASensor_isDirectChannelTypeSupported(const(ASensor)* sensor, int channelType)

Test if sensor supports a certain type of direct channel.

ASensor_isWakeUpSensor
bool ASensor_isWakeUpSensor(const(ASensor)* sensor)

Returns true if this is a wake up sensor, false otherwise.

Manifest constants

ASENSOR_MAGNETIC_FIELD_EARTH_MAX
enum ASENSOR_MAGNETIC_FIELD_EARTH_MAX;

Maximum magnetic field on Earth's surface in uT

ASENSOR_MAGNETIC_FIELD_EARTH_MIN
enum ASENSOR_MAGNETIC_FIELD_EARTH_MIN;

Minimum magnetic field on Earth's surface in uT

ASENSOR_RESOLUTION_INVALID
enum ASENSOR_RESOLUTION_INVALID;

Structures and functions to receive and process sensor events in native code.

ASENSOR_STANDARD_GRAVITY
enum ASENSOR_STANDARD_GRAVITY;

Earth's gravity in m/s^2

Structs

ASensor
struct ASensor

{@link ASensorEventQueue} is an opaque type that provides access to {@link ASensorEvent} from hardware sensors.

ASensorEventQueue
struct ASensorEventQueue

{@link ASensorManager} is an opaque type to manage sensors and events queues.

ASensorVector
struct ASensorVector

A sensor event.

Meta